<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8">
    <title>>>Surprise<<</title>
    <script src="https://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
    <div style="text-align: center;">
        <h2>访问异常，请重新登陆！</h2></br>
        页面将在<span id="time"></span>秒后自动跳转..
        <button id="tologin">立即跳转</button>
    </div>

    <script>
        const _pathName = window.document.location.pathname;
        const _projectName = _pathName.substring(0,_pathName.substr(1).indexOf('/')+1);
        const time = 3000;
        const time_text = 3;
        // 设置倒计时默认值
        $("#time").text(time_text);
        // 设置倒计时显示 -1
        setInterval(function () {
            $("#time").text($("#time").text()-1);
        }, 1000);
        // 设置倒计时跳转
        setTimeout(tologin, time);

        function tologin() {
            window.location.href = _projectName + "/login/toLogin";
        }
        $("#tologin").click(tologin);
    </script>
</body>
</html>
